package cn.gjxblog.aop.proxy.spring.demo2;

import cn.gjxblog.aop.proxy.spring.demo1.UserService;
import org.springframework.aop.framework.ProxyFactoryBean;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 入口
 * @see org.springframework.aop.framework.ProxyFactoryBean#getObject()
 */
public class TestProxyFactoryBean {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ProxyFactoryBeanConfig.class);

        UserService userService = (UserService) context.getBean("proxyFactoryBean");
        Object user = userService.getUser(2);
        System.out.println(user);
    }
}
